package cate.game.activity.wishtower.msg;

import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.activity.warorder.RoleWarOrder;
import cate.game.activity.wishtower.RoleWishTower;
import cate.game.client.ClientContext;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBWishTower;
import easy.java.dev.note.NoteField;
import easy.java.practice.errorcode.EcResult;

public class WishTowerDrawItemReq implements MsgInput {
    @NoteField("功能ID")
    public int funcId;
    @Override
    public void execute(GameBody game, ClientContext cc) {
        RoleWishTower tower = cc.getRole().getActivity().getEnableActivitySingle(funcId);
        if (tower == null) {
            cc.getRole().getGame().notice.message(cc.getRole(), "活动未开启");
            return;
        }
        GameResult<Void> r = tower.drawItem();
        game.notice.message(cc.getRole(), r, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBWishTower.DRAW_ITEM_REQ;
    }
}
